package com.example.administrator.test2;

/**
 * Created by Administrator on 2017-03-29.
 */
import android.provider.ContactsContract;

import java.text.SimpleDateFormat;
import java.util.Date;

public class time {
    public Date getTime(){
        Date curDate=new Date(System.currentTimeMillis());
        return  curDate;
    }
    public String channge(Date time){
        SimpleDateFormat formatter=new SimpleDateFormat("yyyy/mm/dd HH:mm:ss");
        String stime=formatter.format(time);
        return stime;
    }
    public int nDaysbetweenTwotime(Date firstDate,Date secondDate){
        int time=(int)((secondDate.getTime()-firstDate.getTime())/(24*60));
        return time;
    }

}
